﻿/*
 * Created by SharpDevelop.
 * User: Administrator
 * Date: 2016/4/21
 * Time: 18:14
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using SharpChannel.Rpc;
using log4net.Config;

namespace TestClient
{
	class Program
	{

        public static void Main(string[] args)
		{
            XmlConfigurator.Configure();

            Common.ITestService service = SharpChannelClient<Common.ITestService>.Instance();
			while(true){
				switch(Console.ReadLine()){
					case "1":
						string line = service.SayHelloTo ("abc");
						Console.WriteLine("test:" + line);
						break;
					case "2":
						Console.WriteLine("test void call");
						service.TestVoid2(1, "abc", new object[]{1, 2, 3});
						break;
					case "3":
						Console.WriteLine("test:" + service.DoTestDO(new Common.TestDO{Name="yangyang", Age=11, Obj = "122"}, new System.Collections.Generic.List<Common.TestDO>{
						                                             	new Common.TestDO{Name="yangyan2g", Age=12, Obj = "122"},
						                                             	new Common.TestDO{Name="yangyang3", Age=13, Obj = "122"},
						                                             }));
						break;
					case "4":
						Console.WriteLine("test:" + service.TestVoid());
						break;

                    case "5":
                        Console.WriteLine(service.GetAllKv<int>(new System.Collections.Generic.List<int>(), "2222"));
                        break;

					case "exit":
						return;
				}
				
			}
		}
	}
}